<div class="section" id="sitemaplist">
	<form action="" name="formlist" id="formlist" method="post">
	<div class="section-title">
		<?php echo $this->document->text['text_header_deptlist']?>
		  <div class="button right">
			<input class="button" type="button" name="print" value="<?php echo $this->document->text['text_printthislist']?>" onclick="printlist()"/>  
			<input class="button" type="button" name="close" value="<?php echo $this->document->text['button_close']?>" onclick="window.close()"/>  
			<input type="hidden" name="display" id="display" value="" />
		</div>
		<div class="clearer">&nbsp;</div>
	</div>
    
    <div class="section-content">
    	<div>
			
		</div>
            <div class="sitemap treeindex" style="width:1000px">
                <table class="data-table" cellpadding="0" cellspacing="0">
                <tbody>
                    <tr class="tr-head">
						<th width="30px">No.</th>
                        <th width="180px"><?php echo $this->document->text['text_customerpartner']?></th>
						<th width="210px"><?php echo $this->document->text['text_address']?></th>
                        <th width="120px"><?php echo $this->document->text['text_phone']?></th>
						<th width="120px"><?php echo $this->document->text['text_fax']?></th>
						<th width="120px"><?php echo $this->document->text['text_email']?></th>
						<th width="120px"><?php echo $this->document->text['text_totaldebt']?></th>
						<th width="100px"><?php echo $this->document->text['text_history']?></th>
                    </tr>
        
        
        <?php
			$index = 0;
            foreach($reports as $item)
            {
				$index += 1;
        ?>
                    <tr>
						<td><?php echo $index?></td>
                        <td><?php echo $item['fullname']?></td>
						<td><?php echo $item['address']?></td>
						<td><?php echo $item['phone']?></td>
						<td><?php echo $item['fax']?></td>
						<td><?php echo $item['email']?></td>
						<td calc="calc" style="text-align:right"><?php echo $item['debtbalance']?></td>
                        <td><a class="orderlink" href="index.php?route=report/service/debtuser&userid=<?php echo $item['userid']?>"><?php echo $this->document->text['text_history']?></a></td>                
                    </tr>
        <?php
            }
        ?>
                        
                                                    
                </tbody>
                </table>
            </div>
        
        
        </form>
        
    </div>
    
</div>
<script language="javascript">
$(function() {
		$("#search_fromdate").datepicker({
				changeMonth: true,
				changeYear: true,
				dateFormat: 'dd/mm/yy'
				});
		
		
		$("#search_todate").datepicker({
				changeMonth: true,
				changeYear: true,
				dateFormat: 'dd/mm/yy'
				});		
		
		$(".calc").each(function(){
			num = formateNumber($(this).html().replace(/,/g,""));
			$(this).html(num);
		});
		
		$('.orderlink').popupWindow({ 
			height:600, 
			width:1020, 
			centerScreen:1,
			scrollbars: 1,
			resizable : 1,
			status: 0,
			location: 0
		});
		
});
		
		

function deleteList1()   
{
	$.post("?route=voucher/search/deleteorder", 
			$("#formlist").serialize(), 
			function(data)
			{
				if(data!="")
				{
					alert(data)
					linkto("?<?php echo $refres?>")
				}
			}
	);
}

function printlist()   
{
	$("#display").val("report");
	$("#formlist").attr("target","_self");
	$("#formlist").submit();
	$("#display").val("report");
	$("#formlist").attr("target","");
}

</script>
